from AUTO_baidu.config.base import Base
from selenium.webdriver.common.by import By

class Page(Base):

    #定位“新闻”
    bd_loc=(By.XPATH,'//*[@id="s-top-left"]/a[1]')
    def bd(self):
        return self.text(self.bd_loc)

    #输入内容
    shuru_loc=(By.XPATH,'//*[@id="chat-textarea"]')
    def shuru_01(self):
        self.send_keys(self.shuru_loc,'我喜欢软件测试')

    #点击百度一下
    ss_loc=(By.XPATH,'//*[@id="chat-submit-button"]')
    def ss_01(self):
        self.click(self.ss_loc)

    #搜索到的页面内容
    ym_loc=(By.XPATH,'//*[@id="wrapper_wrapper"]')
    def ym_01(self):
        return self.text(self.ym_loc)






    # 输入内容
    shuru_loc2 = (By.XPATH, '//*[@id="kw"]')
    def shuru_02(self) :
        self.send_keys(self.shuru_loc2, '我喜欢软件测试')

    # 点击百度一下
    ss_loc2 = (By.XPATH, '//*[@id="su"]')

    def ss_02(self) :
        self.click(self.ss_loc2)

    # 搜索到的页面内容
    ym_loc2 = (By.XPATH, '//*[@id="wrapper_wrapper"]')

    def ym_02(self) :
        return self.text(self.ym_loc2)




    elements=(By.XPATH,'//*[@id="wrapper_wrapper"]')
    def elements_loc(self):
        self.find_elements(self.elements)

    two_loc=(By.XPATH,'/html/body/div[3]/div[4]/div[2]/div/div/a[2]/span')
    def two(self):
        self.click(self.two_loc)

    sannei_loc=(By.XPATH,'//*[@id="wrapper_wrapper"]')
    def ym_03(self) :
        return self.text(self.sannei_loc)